using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using UnityEngine;

[System.Serializable]
public class AttackRanges
{
    /// <summary>
    /// 对应的连击次数  作为索引
    /// </summary>
    public AttackRange[] ranges = new AttackRange[1];

    //索引器
    public AttackRange this[int index]
    {
        get
        {
            // return ranges.FirstOrDefault(x => x.combo == index);
            //如果没有，默认用第一个
            if (index >= ranges.Length)
                return ranges[0];
            return ranges[index];
        }
    }
}


[System.Serializable]
public class AttackRange
{
    public SerializableVector2 offset = new();
    public SerializableVector2 size = new();
    public float rotation = 0;

    public UnityEngine.Vector2 Offset => offset.ToVector2();
    public UnityEngine.Vector2 Size => size.ToVector2();
}